<template>

<div>
    <p>子组件</p>
    <button @click="on">调用父组件方法</button>
</div>
</template>

<script setup lang="ts">
import { defineExpose,defineEmits } from 'vue'  

const emit = defineEmits(['parent-event','parent2-event'])
const sonDo = () => {
    console.log('子方法调用');
}

const on = () => {
   emit('parent2-event',{ message: '子组件方法调用'})
}

defineExpose({ sonDo })

</script>

<style>

</style>